package com.taotao.config;

import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class InfluxDbConfig {

    @Value("${influx.db.url}")
    private String url;

    @Value("${influx.db.username}")
    private String username;

    @Value("${influx.db.password}")
    private String password;

    @Value("${influx.db.database}")
    private String database;

    @Bean
    public InfluxDB influxDB() {
        InfluxDB influxDB = InfluxDBFactory.connect(url, username, password);
        return influxDB;
    }
}